package cn.com.yitong.service.impl;

import cn.com.yitong.utils.PageUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.com.yitong.domain.User;
import cn.com.yitong.service.UserService;
import cn.com.yitong.mapper.UserMapper;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
* @author Administrator
* @description 针对表【user】的数据库操作Service实现
* @createDate 2022-05-06 11:16:19
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page wrapperPage = PageUtils.getWrapperPage(params);
        //构建查询条件
        QueryWrapper<User> queryWrapper = this.buildQueryWrapper(params);
        IPage<User> page = this.page(
                wrapperPage,
                queryWrapper
        );
        return new PageUtils(page);
    }

    private QueryWrapper<User> buildQueryWrapper(Map<String, Object> params) {
        //TODO:构建查询条件
        return new QueryWrapper<>();
    }
}




